<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <title>Bootstrap 5 实例</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" th:href="@{/css/bootstrap.min.css}">
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.2/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>
    <nav class="navbar navbar-expand-sm navbar-dark bg-dark">
        <div class="container-fluid">
          <a class="navbar-brand" href="javascript:void(0)">Logo</a>
          <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mynavbar">
            <span class="navbar-toggler-icon"></span>
          </button>
          <div class="collapse navbar-collapse" id="mynavbar">
            <ul class="navbar-nav me-auto">
              <li class="nav-item">
                <a class="nav-link" href="javascript:void(0)">链接</a>
              </li>
              <li class="nav-item">
                <a class="nav-link" href="javascript:void(0)">链接</a>
              </li>
              <li class="nav-item">
                <a class="nav-link" href="javascript:void(0)">链接</a>
              </li>
            </ul>
            <form class="d-flex">
              <input class="form-control me-2" type="text" placeholder="Search">
              <button class="btn btn-primary" type="button">Search</button>
            </form>
          </div>
        </div>
      </nav>
    <p th:text="${msg}">Welcome to our grocery store!</p>
<div class="container mt-5">
  <div class="row">
    <div class="card col-sm-3" style="width:400px"  th:each="user : ${users}">
        <img class="card-img-top" src="avatar.png" alt="Card image">
        <div class="card-body" th:object="${user}">
          <h4 class="card-title text-warning" th:text="${name}">战争与和平</h4>
          <p class="card-text text-danger" th:text="sex">我没看过,但是肯定好看,因为都说好看</p>
          <a href="http://127.0.0.1/book/buy" class="btn btn-primary">购买</a>
          <button type="button" class="btn btn-warning">购买</button>
<button type="button" class="btn btn-danger">购买</button>
        </div>
      </div>
    <input th:value="替换">
    <p class="text-danger" th:text="${html}">我没看过,但是肯定好看,因为都说好看</p>

      <div>[[${msg}]]</div>

  </div>
</div>

<script th:inline="javascript">
    let msg = /*[[${msg}]]*/ test;
    console.log(msg)
</script>

</body>
</html>
